﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NetTalkControl : MonoBehaviour
{
    public GameObject can;//获取窗口对象

    public static bool netTalkContolBoll = false;

    private void TalkWindowOpen()//开启聊天窗口
    {
        can.gameObject.SetActive(true);
    }

    private void TalkWindowCloss()//关闭聊天窗口
    {
        can.gameObject.SetActive(false);
    }

    private void Update()
    {
        /*if (Input.GetKeyDown(KeyCode.Y))
        {
            netTalkContolBoll = true;
        }
        if (Input.GetKeyDown(KeyCode.U))
        {
            netTalkContolBoll = false;
        }*/


        if (netTalkContolBoll == true)
        {
            TalkWindowOpen();
        }
        if(netTalkContolBoll == false)
        {
            TalkWindowCloss();
        }
    }
}
